package com.yang.coller;

import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class Main {
    public static void main(String[] args) {
        //集合属性赋值
        ApplicationContext ioc = new ClassPathXmlApplicationContext("application.xml");
        Person person = (Person) ioc.getBean("person3");
        System.out.println(person);

        NewPerson newPerson = (NewPerson) ioc.getBean("newPerson");
        System.out.println(newPerson);


        DataSource dataSource = (DataSource) ioc.getBean("dataSource");
        System.out.println(dataSource.getProperties());

        Person person1 = (Person) ioc.getBean("person4");
        System.out.println("-----------"+person1);


        Person person2 = (Person) ioc.getBean("person5");
        System.out.println("-----------"+person2);

    }
}
